package com.example.iread.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;

import com.example.iread.bean.BookBean;

import java.util.List;

@Dao
public interface BookDao {

    @Insert
    void insert(BookBean ...bookBeans);

    @Delete
    void delete(BookBean ...bookBeans);

    @Query("SELECT * FROM book_history ORDER BY _id DESC")
    List<BookBean> getList();

    @Query("DELETE FROM book_history WHERE id = :id")
    void deleteById(int id);

}
